<template>
  <yt-page title="企业信息详情" scroll>
    <yt-card title="基本信息">
      <yt-cell label="企业名称" :value="item.EnterpriseName"></yt-cell>
      <yt-cell label="企业类型" :value="item.EconomyType"></yt-cell>
      <yt-cell label="行业类别" :value="item.IndustryCategories"></yt-cell>
      <yt-cell label="企业地址" :value="item.LocationAddressDetails"></yt-cell>
      <yt-textarea disabled title="经营范围" v-model="item.BusinessScope"></yt-textarea>
    </yt-card>
  </yt-page>
</template>

<script>
import { commonApi } from '@/common/api/commonApi.js'
import { ReplaceDictionary } from '@/common/utils/index.js'

export default {
  data() {
    return {
      item: {}
    }
  },
  activated() {
    this.initData()
  },
  methods: {
    async initData() {
      let p = [
        commonApi.searchById('ent_enterprise_register', this.$route.query.id),
        commonApi.dictionary('industry_type'),
        commonApi.dictionary('enterprise_type')
      ]
      let [item, industryTypeDic, entTypeDic] = await Promise.all(p)
      this.item = ReplaceDictionary(item, {
        IndustryCategories: industryTypeDic,
        EconomyType: entTypeDic
      })
    }
  }
}
</script>

<style scoped lang="stylus">
.yt-collapse-content
  ul
    padding 0 20px

  li
    line-height 20px
    font-size 12px
    color #aaa

    span
      margin-right 10px

>>>.yt-textarea-input
  min-height 150px
</style>
